# -*- coding: utf-8 -*-
# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#     http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

# Generated by Django 3.2.12 on 2022-03-31 04:00

from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('api', '0007_config_runtime'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProcessSpecPlan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=32, verbose_name='进程规格方案名称')),
                ('region', models.CharField(max_length=32)),
                ('environment', models.CharField(max_length=32, verbose_name='适用环境')),
                ('max_replicas', models.IntegerField(verbose_name='最大副本数')),
                ('limits', jsonfield.fields.JSONField(default={})),
                ('requests', jsonfield.fields.JSONField(default={})),
                ('is_active', models.BooleanField(default=True, verbose_name='是否可用')),
            ],
            options={
                'get_latest_by': 'created',
                'unique_together': {('name', 'region', 'environment')},
            },
        ),
        migrations.CreateModel(
            name='ProcessSpec',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('region', models.CharField(help_text='部署区域', max_length=32)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=32, verbose_name='进程名称')),
                ('type', models.CharField(max_length=32, verbose_name='计算单元组类型（deprecated）')),
                ('target_replicas', models.IntegerField(default=1, verbose_name='期望副本数')),
                ('target_status', models.CharField(default='start', max_length=32, verbose_name='期望状态')),
                ('engine_app', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name='process_specs', to='api.app')),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='processes.processspecplan')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
